package com.mlz.mlzmall.ui.dialog;

import android.content.Context;
import android.graphics.drawable.ColorDrawable;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.PopupWindow;

import com.mlz.mlzmall.R;


/**
 * 弹框
 * ed by xbin on 2015/9/2.
 */
public class QuitDialog {
    public static View pw;
    public static PopupWindow pWindow;
    public static Button btn_quit;

    public static void Quit(Context context) {
        //  退出对话框
        pw = LayoutInflater.from(context).inflate(R.layout.quit_layout, null);
        btn_quit=(Button)pw.findViewById(R.id.button);
        pWindow = new PopupWindow(pw, ViewGroup.LayoutParams.MATCH_PARENT,
                ViewGroup.LayoutParams.WRAP_CONTENT);//弹框显示大小
        pWindow.setFocusable(true);
        pWindow.setBackgroundDrawable(new ColorDrawable(0x55000000));//设置背景为透明
        pWindow.setAnimationStyle(R.style.AnimationBottom);
        pWindow.showAtLocation(pw, Gravity.BOTTOM, 0, 0);

    }
}
